package day03;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Station_information {
    private String arrivalTime;
    private int stop_time;

    public Station_information() {
    }

    public Station_information(String arrivalTime, int stop_time) {
        this.arrivalTime = arrivalTime;
        this.stop_time = stop_time;
    }

    public String getArrivalTime() {
        return arrivalTime;
    }

    public void setArrivalTime(String arrivalTime) {
        this.arrivalTime = arrivalTime;
    }

    public int getStop_time() {
        return stop_time;
    }

    public void setStop_time(int stop_time) {
        this.stop_time = stop_time;
    }
    @Override
    public String toString(){
        return String.format("%-8s %-4d分钟", arrivalTime, stop_time);
    }
}

public class test {
    public static void main(String[] args) {
        Scanner res = new Scanner(System.in);
        Map<String, Station_information> s = new HashMap<>();

        int num;
        System.out.print("输入车站总数：");
        num = res.nextInt();
        for (int i = 1; i <= num; i++) {
            System.out.print("输入第" + i + "站名：");
            String station_name = res.next();
            System.out.print("输入第" + i + "到站时间：");
            String arrivalTime = res.next();
            System.out.print("输入第" + i + "停站时间：");
            int stop_time = res.nextInt();
            s.put(station_name, new Station_information(arrivalTime, stop_time));
        }
        for (Map.Entry<String,Station_information> entry: s.entrySet()){
            System.out.printf("%-8s%s\n",entry.getKey(),entry.getValue());
        }
    }
}
